﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ILog.cs" company="XamlNinja">
//   2011 Richard Griffin and Ollie Riches
// </copyright>
// <summary>
//   Interface defining the logging API.
// </summary>
// --------------------------------------------------------------------------------------------------------------------


using System.Diagnostics;
using System;

namespace Logging
{
    public sealed class DebugLog : ILog
    {
        public ILog Write(string message)
        {
            Debug.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToUniversalTime(), message));
            return this;
        }

        public ILog Write(string message, params object[] args)
        {
            var messageWithParameters = string.Format(message, args);
            Debug.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToUniversalTime(), messageWithParameters));

            return this;
        }

        public ILog Write(string message, Exception exception)
        {
            Debug.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToUniversalTime(), message));
            Debug.WriteLine((string.Format("{0} - Exception '{1}'", DateTime.Now.ToUniversalTime(), exception.ToString())));

            return this;
        }

        public ILog WriteDiagnostics()
        {
            Debug.WriteLine(string.Format("{0} - NOT IMPLEMENTED!", DateTime.Now.ToUniversalTime()));
            return this;
        }
    }
}